package com.freewater.javabase.demo.reflect.methodhandler;

public class HandleTarget {
    private String name = "hello world";

    public HandleTarget() {
    }

    public HandleTarget(String name) {
        this.name = name;
    }

    public void connectName(String name) {
        this.name = this.name + " " + name;
    }

    public String getName() {
        System.out.println("getName invoked");
        return name;
    }

    private void learnPrograming(String lang) {
        System.out.printf("I am learning %s\n", lang);
    }

    public static String declaration(String author) {
        return author + ": " + "吾生也有涯，而知也无涯。以有涯随无涯，殆己";
    }

    @Override
    public String toString() {
        return "HandleTarget{" + "name='" + name + '\'' + '}';
    }
}
